/* Ejercicio 4.26
   ejer4_26.c */
#include <stdio.h>

/* funcion main, el programa inicia aca */
int main( void )
{
    double pi = 0;
    int denominator, counter, sign;

    denominator = 1;
    sign = 1;

    for ( counter = 1; counter <= 1000000000; counter++ ) {
        pi += sign * 4.0 / denominator;
        sign *= -1;
        denominator += 2;
    }

    printf( "%dst term\t=> PI = %.10f\n", counter - 1, pi );

	return 0;
} /* fin de la funcion main */
